Skip to content

Minor fixes#2214

Merged
cgwalters merged 2 commits into
bootc-dev:mainfrom
Johan-Liebert1:minor-fixes
May 27, 2026
Merged

Minor fixes#2214
cgwalters merged 2 commits into
bootc-dev:mainfrom
Johan-Liebert1:minor-fixes

Conversation

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator

Use OnceLock to store the detected bootloader

We use the get_bootloader function frequently and the value will never
change so just cache it


composefs/gc: Change function signature

Update function signature for composefs_gc to take in a GCOpts
struct with named fields instead of two booleans

@Johan-Liebert1 Johan-Liebert1 requested a review from cgwalters May 26, 2026 10:25
@bootc-bot bootc-bot Bot requested a review from jeckersb May 26, 2026 10:25

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the composefs_gc function to accept a new GCOpts struct instead of separate boolean parameters, improving code readability and maintainability. Additionally, it optimizes the get_bootloader function by caching the detected bootloader in a OnceLock to avoid redundant UEFI variable reads. The feedback suggests deriving standard traits (Debug, Clone, Copy, PartialEq, Eq) on the new GCOpts struct and simplifying the get_bootloader implementation by removing redundant .clone() calls and utilizing idiomatic Rust patterns.

Comment thread crates/lib/src/bootc_composefs/gc.rs
Comment thread crates/lib/src/bootc_composefs/status.rs Outdated
We use the `get_bootloader` function frequently and the value will never
change so just cache it

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Update function signature for `composefs_gc` to take in a `GCOpts`
struct with named fields instead of two booleans

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
@cgwalters cgwalters added this pull request to the merge queue May 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 26, 2026
@cgwalters cgwalters added this pull request to the merge queue May 26, 2026
Merged via the queue into bootc-dev:main with commit 1bed68f May 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants